package com.xinsoft.entity.dto;

import cn.hutool.core.util.ObjectUtil;
import com.xinsoft.entity.vo.ErpOutSourcingItemVO;
import lombok.Data;

import java.math.BigDecimal;

/**
 * @author: π
 * 委外合同 明细
 * */
@Data
public class KisOutSourcingBodyVO {

    // 单据明细
    private String FInterId;         //主表主键
    private String  FEntryID;       //行号" 金蝶子表主键
    private String  FItemID;       //物料代码"
    private String  FBomInterID;       //客户BOM编号"
    private String  FAuxQty;       //选单数量"
    private String  FQty;       //基本单位选单数量"
    private String  FStockQty;       //基本单位已领数量"
    private String  FAuxCommitQty;       //收料数量"
    private String  FAuxStockQty;       //已领数量"
    private String  FUnitID;       //单位"
    private String  FNote;       //备注"
    private String  FFetchDate;       //交货日期"



//    {   FInterID + FEntryID
//        单据内码 主表主键  \"FInterID\": \"219642\",
//        行号  \"FEntryID\": \"1\",
//        数量  \"FAuxQty\": \"11118.0000000000\",
//        源单编号  \"FBillNo_SRC\": \"\",
//        源单行号  \"FEntryID_SRC\": \"0\",
//        物料代码  \"FItemID\": \"39302\",
//        BOM编号内码  \"FBOMInterID\": \"11847\",
//        分录内码  \"FDetailID\": \"5599\",
//
//
//        金额  \"FAmount\": \"0.0000\",
//        折扣额  \"FAmtDiscount\": \"0.0000\",
//        常用退料数量  \"FAuxBCommitQty\": \"0.0000000000\",
//        关联数量  \"FAuxCommitQty\": \"0.0000000000\",
//        入库数量  \"FAuxStockQty\": \"0.0000000000\",
//        价税合计  \"FAllAmount\": \"0.0000000000\",
//        基本退料数量  \"FBCommitQty\": \"0.0000000000\",
//        源单类型  \"FClassTypeID_SRC\": \"0\",
//        基本关联数量  \"FCommitQty\": \"0.0000000000\",
//        销售订单行号  \"FEntryIDOrder_SRC\": \"0\",
//        交货日期  \"FFetchDate\": \"2023/2/24 0:00:00\",
//        顺序号  \"FIndex\": \"0\",
//        入库上限数量  \"FInHighLimitQty\": \"11118.0000000000\",
//        订单内码  \"FInterIDOrder_SRC\": \"0\",
//        对应代码  \"FMapID\": \"0\",
//        对应名称  \"FMapName\": \"\",
//        销售订单号  \"FOrderNo\": \"\",
//        基本入库数量  \"FStockQty\": \"0.0000000000\",
//        单位  \"FUnitID\": \"276\",
//          \"FTaxAmount\": \"0.0000000000\",
//          \"FPayShipDate\": \"2023/2/24 0:00:00\",
//          \"FDiscountRate\": \"0.0000000000\",
//          \"FAuxQtyInvoice\": \"0.0000000000\",
//          \"FAuxPrice\": \"0.0000000000\",
//          \"FAuxPriceDiscount\": \"0.0000000000\",
//          \"FAuxPropID\": \"0\",
//          \"FInHighLimit\": \"0.0000000000\",
//          \"FPORInterID\": \"0\",
//          \"FPORNumber\": \"\",
//          \"FInLowLimit\": \"0.0000000000\",
//          \"FAuxTaxPrice\": \"0.0000000000\",
//          \"FInLowLimitQty\": \"11118.0000000000\",
//          \"FInterID_SRC\": \"0\",
//          \"FQty\": \"11118.0000000000\",
//          \"FQtyInvoice\": \"0.0000000000\",
//          \"FReceiveAmountFor_Commit\": \"0.0000\",
//          \"FSecCoefficient\": \"0.0000000000\",
//          \"FSecCommitQty\": \"0.0000000000\",
//          \"FMrpAutoClosed\": \"1\",
//          \"FMrpClosed\": \"0\",
//          \"FMRPLockFlag\": \"0\",
//          \"FMrpTrackFlag\": \"0\",
//          \"FNote\": \"1.0*1239*C\",
//          \"FSecQty\": \"0.0000000000\",
//          \"FSecQtyInvoice\": \"0.0000000000\",
//          \"FStdAllAmount\": \"0.0000000000\",
//          \"FTaxRate\": \"13.0000000000\"
//    }FAuxCommitQty


    public ErpOutSourcingItemVO voToPo(KisOutSourcingBodyVO item) {
        if (item == null) {
            return null;
        }
        ErpOutSourcingItemVO scmOutSourcingItemVO = new ErpOutSourcingItemVO();
        scmOutSourcingItemVO.setId(ObjectUtil.isEmpty(item.getFEntryID()) ? null : new Integer(item.getFEntryID()));
        scmOutSourcingItemVO.setHeadId(ObjectUtil.isEmpty(item.getFInterId()) ? null : new Integer(item.getFInterId()));
        scmOutSourcingItemVO.setMaterialId(ObjectUtil.isEmpty(item.getFItemID()) ? null : new Integer(item.getFItemID()));
        scmOutSourcingItemVO.setBomID(ObjectUtil.isEmpty(item.getFItemID()) ? null : new Integer(item.getFItemID()));
        scmOutSourcingItemVO.setMainUnitId(ObjectUtil.isEmpty(item.getFUnitID()) ? null : new Integer(item.getFUnitID()));
        scmOutSourcingItemVO.setAuxFtockQty(ObjectUtil.isEmpty(item.getFAuxStockQty()) ? null : new BigDecimal(item.getFAuxStockQty()));
        scmOutSourcingItemVO.setFQty(ObjectUtil.isEmpty(item.getFQty()) ? null : new BigDecimal(item.getFQty()));
        scmOutSourcingItemVO.setAuxQty(ObjectUtil.isEmpty(item.getFAuxQty()) ? null : new BigDecimal(item.getFAuxQty()));
        scmOutSourcingItemVO.setStockQty(ObjectUtil.isEmpty(item.getFStockQty()) ? null : new BigDecimal(item.getFStockQty()));
        scmOutSourcingItemVO.setAuxCommitQty(ObjectUtil.isEmpty(item.getFAuxCommitQty()) ? null : new BigDecimal(item.getFAuxCommitQty()));
        scmOutSourcingItemVO.setDeliveryDate(item.getFFetchDate());
        scmOutSourcingItemVO.setRemark(item.getFNote());
        return scmOutSourcingItemVO;
    }

//    {
//          \"FInterID\": \"15000\",
//          \"FEntryID\": \"1\",
//          \"FIndex\": \"0\",
//          \"FQty\": \"800.0000000000\",
//          \"FAuxQty\": \"800.0000000000\",
//          \"FStockQty\": \"0.0000000000\",
//          \"FAuxStockQty\": \"0.0000000000\",


//          \"FDetailID\": \"180\",
//          \"FItemID\": \"10320\",
//          \"FMapID\": \"0\",
//          \"FMapName\": \"\",
//          \"FAuxPropID\": \"0\",
//          \"FSecQty\": \"0.0000000000\",
//          \"FSecCommitQty\": \"0.0000000000\",
//          \"FSecCoefficient\": \"0.0000000000\",
//          \"FUnitID\": \"1413\",
//          \"FAuxPrice\": \"0.7079646000\",
//          \"FAuxTaxPrice\": \"0.8000000000\",
//          \"FAmount\": \"566.3700\",
//          \"FDiscountRate\": \"0.0000000000\",
//          \"FAuxPriceDiscount\": \"0.8000000000\",
//          \"FAmtDiscount\": \"0.0000\",
//          \"FTaxRate\": \"13.0000000000\",
//          \"FTaxAmount\": \"73.6300000000\",
//          \"FAllAmount\": \"640.0000000000\",
//          \"FStdAllAmount\": \"640.0000000000\",
//          \"FPayShipDate\": \"9/8/2023 12:00:00 AM\",
//          \"FFetchDate\": \"9/25/2023 12:00:00 AM\",
//          \"FBOMInterID\": \"2212\",
//          \"FInHighLimit\": \"0.0000000000\",
//          \"FInLowLimit\": \"0.0000000000\",
//          \"FNote\": \"\",
//          \"FMrpAutoClosed\": \"1\",
//          \"FMrpClosed\": \"0\",
//          \"FMRPLockFlag\": \"0\",
//          \"FClassTypeID_SRC\": \"-70\",
//          \"FEntryID_SRC\": \"1\",
//          \"FInterID_SRC\": \"21922\",
//          \"FBillNo_SRC\": \"POREQ021920\",
//          \"FInterIDOrder_SRC\": \"7938\",
//          \"FEntryIDOrder_SRC\": \"6\",
//          \"FOrderNo\": \"I.O.:13069\",
//          \"FInHighLimitQty\": \"800.0000000000\",
//          \"FInLowLimitQty\": \"800.0000000000\",
//          \"FAuxCommitQty\": \"0.0000000000\",
//          \"FCommitQty\": \"0.0000000000\",
//          \"FAuxQtyInvoice\": \"0.0000000000\",
//          \"FQtyInvoice\": \"0.0000000000\",
//          \"FReceiveAmountFor_Commit\": \"0.0000\",
//          \"FPlanMode\": \"14036\",
//          \"FMTONo\": \"\",
//          \"FMrpTrackFlag\": \"0\",
//          \"FPORInterID\": \"0\",
//          \"FPORNumber\": \"\",
//          \"FBCommitQty\": \"0.0000000000\",
//          \"FAuxBCommitQty\": \"0.0000000000\",
//          \"FSecQtyInvoice\": \"0.0000000000\",
//          \"FSecBCommitQty\": \"0.0000000000\",
//          \"FSecStockQty\": \"0.0000000000\",
//          \"FText\": \"\"
//    }

}
